/**   
 * Copyright 2011 COMERE Harold
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package etrl.core;

/**
 * \class Viewport
 * \brief Storage class to keep viewport data
 * @author harold
 *
 */
public class Viewport
{
	/**
	 * X coordinate of the viewport lower left corner
	 */
	private int _x;
	
	/**
	 * Y coordinate of the viewport lower left corner
	 */
	private int _y;
	
	/**
	 * Width of the viewport
	 */
	private int _width;
	
	/**
	 * Height of the viewport
	 */
	private int _height;
	
	/**
	 * \brief Initializes the viewport with the given data
	 * @param[in] x X coordinate of the viewport lower left corner
	 * @param[in] y Y coordinate of the viewport lower left corner
	 * @param[in] width Width of the viewport
	 * @param[in] height Height of the viewport
	 */
	public Viewport(int x, int y, int width, int height)
	{
		_x = x;
		_y = y;
		_width = width;
		_height = height;
	}
	
	/**
	 * \brief Get viewport data as float array.
	 * @return Viewport data
	 */
	public int[] getValues()
	{
		int[] tab = new int[4];
		tab[0] = _x;
		tab[1] = _y;
		tab[2] = _width;
		tab[3] = _height;
		return tab;
	}
}
